﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:local="clr-namespace:SharePointLogViewer"                                        
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <local:BackgroundStripe x:Key="BackgroundStripe"/>
    <Style x:Key="AlternatingListViewItemStyle" TargetType="{x:Type ListViewItem}">        
        <Style.Triggers>
            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                <Setter Property="Background" Value="#EFEFEF" />
                <Setter Property="Opacity" Value="1"/>
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="{StaticResource ListItemSelectedColor}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{StaticResource ListItemHoverColor}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <LinearGradientBrush x:Key="HeadingBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#828487" Offset="0"/>
        <GradientStop Color="#7E8083" Offset="0.5"/>
        <GradientStop Color="#555A5E" Offset="0.9"/>
        <GradientStop Color="#FFFFFF" Offset="1"/>
    </LinearGradientBrush>

    <LinearGradientBrush  x:Key="BlueRinseBrush" 
                          EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF223B84" Offset="1"/>
        <GradientStop Color="#FF57A0F4" Offset="0.5"/>
        <GradientStop Color="#FF4B94EC" Offset="0.5"/>
    </LinearGradientBrush>
    <!-- Create stylised filter buttons -->
    <Style x:Key="filterButtonInactive" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Width="18" Height="18">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <Ellipse Grid.RowSpan="1" Grid.ColumnSpan="1" Margin="2.5">
                            <Ellipse.Fill>
                                <RadialGradientBrush Center="0.5,0.5" GradientOrigin="0.5,0.0" RadiusX="0.7" RadiusY="0.5" >
                                    <RadialGradientBrush.GradientStops>
                                        <GradientStop Color="Silver" Offset="0"/>
                                        <GradientStop Color="SkyBlue" Offset="1"/>
                                    </RadialGradientBrush.GradientStops>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Ellipse Grid.RowSpan="1" Grid.ColumnSpan="1" Margin="2.5">
                            <Ellipse.Fill>
                                <RadialGradientBrush Center="0.5,0.5" GradientOrigin="0.5,1.0" RadiusX="0.7" RadiusY="0.5" >
                                    <RadialGradientBrush.GradientStops>
                                        <GradientStop Color="AliceBlue" Offset="0"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                    </RadialGradientBrush.GradientStops>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Ellipse Grid.RowSpan="1" Grid.ColumnSpan="1" Margin="1.5">
                            <Ellipse.Stroke>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Black" Offset="0"/>
                                    <GradientStop Color="LightGray" Offset="1"/>
                                </LinearGradientBrush>
                            </Ellipse.Stroke>
                        </Ellipse>
                        <Path  Grid.RowSpan="1" Grid.ColumnSpan="1"
                              Fill="Black"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Data="M 0 1 L 4 5 L 8 1 Z"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="filterButtonActive" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Width="18" Height="18">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        
                        <Ellipse Grid.RowSpan="1" Grid.ColumnSpan="1" Margin="2.5">
                            <Ellipse.Fill>
                                <RadialGradientBrush Center="0.5,0.5" GradientOrigin="0.5,0.0" RadiusX="0.7" RadiusY="0.5" >
                                    <RadialGradientBrush.GradientStops>
                                        <GradientStop Color="White" Offset="0"/>
                                        <GradientStop Color="DarkBlue" Offset="1"/>
                                    </RadialGradientBrush.GradientStops>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Ellipse Grid.RowSpan="1" Grid.ColumnSpan="1" Margin="2.5">
                            <Ellipse.Fill>
                                <RadialGradientBrush Center="0.5,0.5" GradientOrigin="0.5,1.0" RadiusX="0.7" RadiusY="0.5" >
                                    <RadialGradientBrush.GradientStops>
                                        <GradientStop Color="AliceBlue" Offset="0"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                    </RadialGradientBrush.GradientStops>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Ellipse Grid.RowSpan="1" Grid.ColumnSpan="1" Margin="1.5">
                            <Ellipse.Stroke>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Color="Black" Offset="0"/>
                                    <GradientStop Color="LightGray" Offset="1"/>
                                </LinearGradientBrush>
                            </Ellipse.Stroke>
                        </Ellipse>
                        <Path  Grid.RowSpan="1" Grid.ColumnSpan="1"
                              Fill="Black"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Data="M 0 0 L 4 4 L 8 0 Z"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="Background" Value="{StaticResource HeadingBrush}"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <!-- Modify the control template so that we do not have a button style  -->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Border Name="border" BorderBrush="Azure" Background="{TemplateBinding Background}">
                        <StackPanel Orientation="Horizontal">
                            <ContentPresenter Margin="4,3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- style the conatiner which renders each individual cell within the sortable grid -->
    <Style TargetType="{x:Type ListViewItem}" x:Key="ListViewItemStyle" >
        <Setter Property="Padding" Value="0,3"/>
        <Setter Property="Background">
            <Setter.Value>
                <Binding RelativeSource="{RelativeSource Self}" Converter="{StaticResource BackgroundStripe}"/>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
        <Setter Property="Width" Value="18"/>
        <Setter Property="Background" Value="{StaticResource NormalBorderBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                        <Rectangle HorizontalAlignment="Center" Height="20" Width="1" Fill="LightGray"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="GridViewColumnHeader">
        <!--x:Key="{x:Type GridViewColumnHeader}" TargetType="GridViewColumnHeader"-->
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="Foreground"
          Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Grid>
                        <Border Name="HeaderBorder"
                                Background="{StaticResource LightBrush}"
                                Padding="2,0,2,0">

                            <ContentPresenter Name="HeaderContent"
                                              Margin="0,0,0,1"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <Thumb x:Name="PART_HeaderGripper"
                                HorizontalAlignment="Right"
                                Margin="0,0,-9,0"
                                Style="{StaticResource GridViewColumnHeaderGripper}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource NormalBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource PressedBrush}"/>
                            <Setter TargetName="HeaderContent"
                                    Property="Margin" Value="1,1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground"
                                    Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000"
                                            Width="{TemplateBinding ActualWidth}"
                                            Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Border Name="HeaderBorder"
                                      BorderThickness="0,1,0,1"
                                      BorderBrush="{StaticResource NormalBorderBrush}"
                                      Background="{StaticResource LightBrush}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="NoArrowHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="Foreground"
          Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Grid>
                        <Border Name="HeaderBorder"
                                BorderThickness="0,1,0,1"
                                BorderBrush="{StaticResource NormalBorderBrush}"
                                Background="{StaticResource LightBrush}"
                                Padding="2,0,2,0">

                            <ContentPresenter Name="HeaderContent"
                                              Margin="0,0,0,1"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <Thumb x:Name="PART_HeaderGripper"
                                HorizontalAlignment="Right"
                                Margin="0,0,-9,0"
                                Style="{StaticResource GridViewColumnHeaderGripper}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource NormalBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource PressedBrush}"/>
                            <Setter TargetName="HeaderContent"
                                    Property="Margin" Value="1,1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground"
                                    Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000"
                                            Width="{TemplateBinding ActualWidth}"
                                            Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Border Name="HeaderBorder"
                                      BorderThickness="0,1,0,1"
                                      BorderBrush="{StaticResource NormalBorderBrush}"
                                      Background="{StaticResource LightBrush}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="UpArrowHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
       <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground"
          Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Grid>
                        <Border Name="HeaderBorder"
                                BorderThickness="0,1,0,1"
                                BorderBrush="{StaticResource NormalBorderBrush}"
                                Background="{StaticResource LightBrush}"
                                Padding="2,0,2,0">
                            <StackPanel x:Name="spHeader" Orientation="Horizontal">

                                <ContentPresenter Name="HeaderContent"
                                              Margin="0,0,0,1"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                <Path x:Name="arrow" VerticalAlignment="Center" HorizontalAlignment="Center" StrokeThickness="1" Fill="Gray" Data="M 5,10 L 15,10 L 10,5 L 5,10"/>
                            </StackPanel>

                        </Border>
                        <Thumb x:Name="PART_HeaderGripper"
                                HorizontalAlignment="Right"
                                Margin="0,0,-9,0"
                                Style="{StaticResource GridViewColumnHeaderGripper}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource NormalBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource PressedBrush}"/>
                            <Setter TargetName="HeaderContent"
                                    Property="Margin" Value="1,1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground"
                                    Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000"
                                            Width="{TemplateBinding ActualWidth}"
                                            Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Border Name="HeaderBorder"
                                      BorderThickness="0,1,0,1"
                                      BorderBrush="{StaticResource NormalBorderBrush}"
                                      Background="{StaticResource LightBrush}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="DownArrowHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground"
          Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Grid>
                        <Border Name="HeaderBorder"
                                BorderThickness="0,1,0,1"
                                BorderBrush="{StaticResource NormalBorderBrush}"
                                Background="{StaticResource LightBrush}"
                                Padding="2,0,2,0">
                            <StackPanel x:Name="spHeader" Orientation="Horizontal">

                                <ContentPresenter Name="HeaderContent"
                                              Margin="0,0,0,1"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                <Path x:Name="arrow" VerticalAlignment="Center" HorizontalAlignment="Center" StrokeThickness="1" Fill="Gray" Data="M 5,5 L 10,10 L 15,5 L 5,5"/>
                            </StackPanel>

                        </Border>
                        <Thumb x:Name="PART_HeaderGripper"
                                HorizontalAlignment="Right"
                                Margin="0,0,-9,0"
                                Style="{StaticResource GridViewColumnHeaderGripper}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource NormalBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderBorder"
                                    Property="Background" Value="{StaticResource PressedBrush}"/>
                            <Setter TargetName="HeaderContent"
                                    Property="Margin" Value="1,1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground"
                                    Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000"
                                            Width="{TemplateBinding ActualWidth}"
                                            Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Border Name="HeaderBorder"
                                      BorderThickness="0,1,0,1"
                                      BorderBrush="{StaticResource NormalBorderBrush}"
                                      Background="{StaticResource LightBrush}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>


</ResourceDictionary>